package com.ekuaitu.kuaitustaff.utils;

/**
 * Created by user1 on 2017/4/11.
 */

public class AreaCodeUtil {
    public String getCodeByCity(String cityName) {
        String code = "";
        for (String[] aCityCodeArray : cityCodeArray) {
            if (aCityCodeArray[0].equals(cityName)) {
                code = aCityCodeArray[1];
                break;
            }
        }
        return code;
    }

    public String getCityByCode(String code) {
        String cityName = "";
        for (String[] aCityCodeArray : cityCodeArray) {
            if (aCityCodeArray[1].equals(code)) {
                cityName = aCityCodeArray[0];
                break;
            }
        }
        return cityName;
    }

    private String[][] cityCodeArray = {
            {"北京", "010"}, {"上海", "021"}, {"天津", "022"}, {"重庆", "023"}, {"香港", "852"},
            {"澳门", "853"}, {"邯郸", "0310"}, {"石家庄", "0311"}, {"保定", "0312"}, {"张家口", "0313"},
            {"承德", "0314"}, {"唐山", "0315"}, {"廊坊", "0316"}, {"沧州", "0317"}, {"衡水", "0318"},
            {"邢台", "0319"}, {"秦皇岛", "0335"}, {"衢州", "0570"}, {"杭州", "0571"}, {"湖州", "0572"},
            {"嘉兴", "0573"}, {"宁波", "0574"}, {"绍兴", "0575"}, {"台州", "0576"}, {"温州", "0577"},
            {"丽水", "0578"}, {"金华", "0579"}, {"舟山", "0580"}, {"沈阳", "024"}, {"铁岭", "0410"},
            {"大连", "0411"}, {"鞍山", "0412"}, {"抚顺", "0413"}, {"本溪", "0414"}, {"丹东", "0415"},
            {"锦州", "0416"}, {"营口", "0417"}, {"阜新", "0418"}, {"辽阳", "0419"}, {"朝阳", "0421"},
            {"盘锦", "0427"}, {"葫芦岛", "0429"}, {"武汉", "027"}, {"襄城", "0710"}, {"鄂州", "0711"},
            {"孝感", "0712"}, {"黄州", "0713"}, {"黄石", "0714"}, {"咸宁", "0715"}, {"荆沙", "0716"},
            {"宜昌", "0717"}, {"恩施", "0718"}, {"十堰", "0719"}, {"随枣", "0722"}, {"荆门", "0724"},
            {"江汉", "0728"}, {"南京", "025"}, {"无锡", "0510"}, {"镇江", "0511"}, {"苏州", "0512"},
            {"南通", "0513"}, {"扬州", "0514"}, {"盐城", "0515"}, {"徐州", "0516"}, {"淮阴", "0517"},
            {"淮安", "0517"}, {"连云港", "0518"}, {"常州", "0519"}, {"泰州", "0523"}, {"海拉尔", "0470"},
            {"呼和浩特", "0471"}, {"包头", "0472"}, {"乌海", "0473"}, {"乌兰察布", "0474"}, {"通辽", "0475"},
            {"赤峰", "0476"}, {"东胜", "0477"}, {"临河", "0478"}, {"锡林浩特", "0479"}, {"乌兰浩特", "0482"},
            {"阿拉善左旗", "0483"}, {"新余", "0790"}, {"南昌", "0791"}, {"九江", "0792"}, {"上饶", "0793"},
            {"临川", "0794"}, {"宜春", "0795"}, {"吉安", "0796"}, {"赣州", "0797"}, {"景德镇", "0798"},
            {"萍乡", "0799"}, {"鹰潭", "0701"}, {"忻州", "0350"}, {"太原", "0351"}, {"大同", "0352"},
            {"阳泉", "0353"}, {"榆次", "0354"}, {"长治", "0355"}, {"晋城", "0356"}, {"临汾", "0357"},
            {"离石", "0358"}, {"运城", "0359"}, {"临夏", "0930"}, {"兰州", "0931"}, {"定西", "0932"},
            {"平凉", "0933"}, {"西峰", "0934"}, {"武威", "0935"}, {"张掖", "0936"}, {"酒泉", "0937"},
            {"天水", "0938"}, {"甘南州", "0941"}, {"白银", "0943"}, {"菏泽", "0530"}, {"济南", "0531"},
            {"青岛", "0532"}, {"淄博", "0533"}, {"德州", "0534"}, {"烟台", "0535"}, {"淮坊", "0536"},
            {"济宁", "0537"}, {"泰安", "0538"}, {"临沂", "0539"}, {"阿城", "0450"}, {"哈尔滨", "0451"},
            {"齐齐哈尔", "0452"}, {"牡丹江", "0453"}, {"佳木斯", "0454"}, {"绥化", "0455"}, {"黑河", "0456"},
            {"加格达奇", "0457"}, {"伊春", "0458"}, {"大庆", "0459"}, {"福州", "0591"}, {"厦门", "0592"},
            {"宁德", "0593"}, {"莆田", "0594"}, {"泉州", "0595"}, {"晋江", "0595"}, {"漳州", "0596"}, {"龙岩", "0597"},
            {"三明", "0598"}, {"南平", "0599"}, {"广州", "020"}, {"韶关", "0751"}, {"惠州", "0752"}, {"梅州", "0753"},
            {"汕头", "0754"}, {"深圳", "0755"}, {"珠海", "0756"}, {"佛山", "0757"}, {"肇庆", "0758"}, {"湛江", "0759"},
            {"中山", "0760"}, {"河源", "0762"}, {"清远", "0763"}, {"顺德", "0765"}, {"云浮", "0766"}, {"潮州", "0768"},
            {"东莞", "0769"}, {"汕尾", "0660"}, {"潮阳", "0661"}, {"阳江", "0662"}, {"揭西", "0663"}, {"成都", "028"},
            {"涪陵", "0810"}, {"攀枝花", "0812"}, {"自贡", "0813"}, {"永川", "0814"},
            {"绵阳", "0816"}, {"南充", "0817"}, {"达县", "0818"}, {"万县", "0819"}, {"遂宁", "0825"},
            {"广安", "0826"}, {"巴中", "0827"}, {"泸州", "0830"}, {"宜宾", "0831"}, {"内江", "0832"},
            {"乐山", "0833"}, {"西昌", "0834"}, {"雅安", "0835"}, {"康定", "0836"}, {"马尔康", "0837"},
            {"德阳", "0838"}, {"广元", "0839"}, {"岳阳", "0730"}, {"长沙", "0731"},
            {"湘潭", "0732"}, {"株州", "0733"}, {"衡阳", "0734"}, {"郴州", "0735"}, {"常德", "0736"},
            {"益阳", "0737"}, {"娄底", "0738"}, {"邵阳", "0739"}, {"吉首", "0743"}, {"张家界", "0744"},
            {"怀化", "0745"}, {"永州冷", "0746"}, {"商丘", "0370"}, {"郑州", "0371"}, {"安阳", "0372"},
            {"新乡", "0373"}, {"许昌", "0374"}, {"平顶山", "0375"}, {"信阳", "0376"}, {"南阳", "0377"},
            {"开封", "0378"}, {"洛阳", "0379"}, {"焦作", "0391"}, {"鹤壁", "0392"}, {"濮阳", "0393"},
            {"周口", "0394"}, {"漯河", "0395"}, {"驻马店", "0396"}, {"三门峡", "0398"}, {"昭通", "0870"},
            {"昆明", "0871"}, {"大理", "0872"}, {"个旧", "0873"}, {"曲靖", "0874"}, {"保山", "0875"},
            {"文山", "0876"}, {"玉溪", "0877"}, {"楚雄", "0878"}, {"思茅", "0879"}, {"景洪", "0691"},
            {"潞西", "0692"}, {"东川", "0881"}, {"临沧", "0883"}, {"六库", "0886"}, {"中甸", "0887"},
            {"丽江", "0888"}, {"滁州", "0550"}, {"合肥", "0551"}, {"蚌埠", "0552"}, {"芜湖", "0553"},
            {"淮南", "0554"}, {"马鞍山", "0555"}, {"安庆", "0556"}, {"宿州", "0557"}, {"阜阳", "0558"},
            {"黄山", "0559"}, {"淮北", "0561"}, {"铜陵", "0562"}, {"宣城", "0563"}, {"六安", "0564"},
            {"巢湖", "0565"}, {"贵池", "0566"}, {"银川", "0951"}, {"石嘴山", "0952"}, {"吴忠", "0953"},
            {"固原", "0954"}, {"长春", "0431"}, {"吉林", "0432"}, {"延吉", "0433"}, {"四平", "0434"},
            {"通化", "0435"}, {"白城", "0436"}, {"辽源", "0437"}, {"松原", "0438"}, {"浑江", "0439"},
            {"珲春", "0440"}, {"防城港", "0770"}, {"南宁", "0771"}, {"柳州", "0772"}, {"桂林", "0773"},
            {"梧州", "0774"}, {"玉林", "0775"}, {"百色", "0776"}, {"钦州", "0777"}, {"河池", "0778"},
            {"北海", "0779"}, {"贵阳", "0851"}, {"遵义", "0852"}, {"安顺", "0853"}, {"都均", "0854"},
            {"凯里", "0855"}, {"铜仁", "0856"}, {"毕节", "0857"}, {"六盘水", "0858"}, {"兴义", "0859"},
            {"西安", "029"}, {"咸阳", "0910"}, {"延安", "0911"}, {"榆林", "0912"}, {"渭南", "0913"},
            {"商洛", "0914"}, {"安康", "0915"}, {"汉中", "0916"}, {"宝鸡", "0917"}, {"铜川", "0919"},
            {"西宁", "0971"}, {"海东", "0972"}, {"同仁", "0973"}, {"共和", "0974"}, {"玛沁", "0975"},
            {"玉树", "0976"}, {"德令哈", "0977"}, {"儋州", "0890"}, {"海口", "0898"}, {"三亚", "0899"},
            {"拉萨", "0891"}, {"日喀则", "0892"}, {"山南", "0893"}
    };


}
